package com.msb.controller;

import com.msb.pojo.Person;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestController {
    @RequestMapping("/test1")
    public String test1() {
        return "index.jsp";
    }
    @RequestMapping("/testParam")
    public String testParam(String name,String password){
        System.out.println(name+":"+password);
        return "index.jsp";
    }


//    Person 将请求参数注入到Person类对象，请求参数名要和属性名一致
    @RequestMapping("/testParam2")
    public String testParam2(Person person){
        System.out.println(person.getName()+":"+person.getAge()+":"+person.getScore());
        return "index.jsp";
    }
}
